-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write details of container volumes to the publishing manifest #2742
Conversation
This looks good to me. The only thing I've got in the back of my head is at least thinking about how this grows into a first class volume resource. Maybe it doesn't and thats OK. |
My thought was in the future we could expand this to support something like the following by adding a new overload of var pgdata = builder.AddContainerVolume("pgdata");
var pgdb = builder.AddPostgres("pg)
.WithVolume(pgdata)
.AddDatabase("db"); The manifest would then be updated to support writing out a container volume that refers to another resource via a '"resource"' property or similar. |
cc @prom3theu5 |
Excellent thanks 😃 You say host bind mounts aren't included. What if for instance it's a Bind mount to an existing folder which contains required config, like Loki config / grafana data sources etc? Wouldn't it be considered to be breaking if config which a service relies on at startup is missing? For k8s I could bundle such directories as a container and use an init container to setup a pvc seeded with the data |
Yeah I think there's definitely ways to make it map, but it seems even Docker sees bind mounts as a legacy and encourages use of volumes instead now. We could of course just emit the bind mounts too and let the deployment tool decide what it wants to do, but ultimately bind mounts will require extra work in deployment to actually package up the hosting directory (if it exists) in some way and get it to the target. Please log an issue to cover emitting bind mount details into the manifest so we can explore the idea further there. |
Ok cheers - Will do 😄 |
Writes container volume details to the manifest. Both named and anonymous volumes are supported. Bind mounts are not written out as they're intended to mount files/directories directly from the container host machine file system into a container which isn't suitable for deployed environments.
This leaves open the possibility of modeling volumes as separate resources in the future to enable shared volumes between different containers but that's out of scope for now (aka #1521).
Related to #1676
AZD issue: Azure/azure-dev#3515
Microsoft Reviewers: Open in CodeFlow